<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Topics tagged with html attribute reference]]></title><description><![CDATA[A list of topics that have been tagged with html attribute reference]]></description><link>https://community.secnto.com//tags/html attribute reference</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 20:45:30 GMT</lastBuildDate><atom:link href="https://community.secnto.com//tags/html attribute reference.rss" rel="self" type="application/rss+xml"/><pubDate>Invalid Date</pubDate><ttl>60</ttl><item><title><![CDATA[HTML Attribute Reference]]></title><description><![CDATA[<h3>HTML Attribute Reference</h3>
<p dir="auto">The table below provides an overview of HTML attributes, including which elements they apply to and their descriptions:</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th><strong>Attribute</strong></th>
<th><strong>Belongs to</strong></th>
<th><strong>Description</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>accept</code></td>
<td><code>&lt;input&gt;</code></td>
<td>Specifies the types of files that the server accepts (for <code>type="file"</code>).</td>
</tr>
<tr>
<td><code>accept-charset</code></td>
<td><code>&lt;form&gt;</code></td>
<td>Specifies the character encodings to be used for form submission.</td>
</tr>
<tr>
<td><code>accesskey</code></td>
<td>Global Attributes</td>
<td>Specifies a shortcut key to activate or focus an element.</td>
</tr>
<tr>
<td><code>action</code></td>
<td><code>&lt;form&gt;</code></td>
<td>Specifies where to send form data when the form is submitted.</td>
</tr>
<tr>
<td><code>align</code></td>
<td>Not supported in HTML 5.</td>
<td>Specifies alignment according to surrounding elements. Use CSS instead.</td>
</tr>
<tr>
<td><code>alt</code></td>
<td><code>&lt;area&gt;</code>, <code>&lt;img&gt;</code>, <code>&lt;input&gt;</code></td>
<td>Provides alternate text when the original element fails to display.</td>
</tr>
<tr>
<td><code>async</code></td>
<td><code>&lt;script&gt;</code></td>
<td>Specifies that the script should be executed asynchronously (for external scripts).</td>
</tr>
<tr>
<td><code>autocomplete</code></td>
<td><code>&lt;form&gt;</code>, <code>&lt;input&gt;</code></td>
<td>Specifies whether autocomplete is enabled for the element.</td>
</tr>
<tr>
<td><code>autofocus</code></td>
<td><code>&lt;button&gt;</code>, <code>&lt;input&gt;</code>, <code>&lt;select&gt;</code>, <code>&lt;textarea&gt;</code></td>
<td>Indicates that the element should automatically get focus when the page loads.</td>
</tr>
<tr>
<td><code>autoplay</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Specifies that the audio/video should start playing as soon as it’s ready.</td>
</tr>
<tr>
<td><code>bgcolor</code></td>
<td>Not supported in HTML 5.</td>
<td>Specifies the background color of an element. Use CSS instead.</td>
</tr>
<tr>
<td><code>border</code></td>
<td>Not supported in HTML 5.</td>
<td>Specifies the width of the border of an element. Use CSS instead.</td>
</tr>
<tr>
<td><code>charset</code></td>
<td><code>&lt;meta&gt;</code>, <code>&lt;script&gt;</code></td>
<td>Defines the character encoding.</td>
</tr>
<tr>
<td><code>checked</code></td>
<td><code>&lt;input&gt;</code></td>
<td>Indicates that an <code>&lt;input&gt;</code> element should be pre-selected (for <code>type="checkbox"</code> or <code>type="radio"</code>).</td>
</tr>
<tr>
<td><code>cite</code></td>
<td><code>&lt;blockquote&gt;</code>, <code>&lt;del&gt;</code>, <code>&lt;ins&gt;</code>, <code>&lt;q&gt;</code></td>
<td>Provides a URL that explains the quote/deleted/inserted text.</td>
</tr>
<tr>
<td><code>class</code></td>
<td>Global Attributes</td>
<td>Assigns one or more class names to an element (refers to a class in a style sheet).</td>
</tr>
<tr>
<td><code>color</code></td>
<td>Not supported in HTML 5.</td>
<td>Specifies the text color of an element. Use CSS instead.</td>
</tr>
<tr>
<td><code>cols</code></td>
<td><code>&lt;textarea&gt;</code></td>
<td>Defines the visible width of a text area.</td>
</tr>
<tr>
<td><code>colspan</code></td>
<td><code>&lt;td&gt;</code>, <code>&lt;th&gt;</code></td>
<td>Specifies how many columns a table cell should span.</td>
</tr>
<tr>
<td><code>content</code></td>
<td><code>&lt;meta&gt;</code></td>
<td>Provides the value associated with the <code>http-equiv</code> or <code>name</code> attribute.</td>
</tr>
<tr>
<td><code>contenteditable</code></td>
<td>Global Attributes</td>
<td>Indicates whether the content of an element is editable.</td>
</tr>
<tr>
<td><code>controls</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Specifies that audio/video controls should be displayed.</td>
</tr>
<tr>
<td><code>coords</code></td>
<td><code>&lt;area&gt;</code></td>
<td>Defines the coordinates of an area in an image map.</td>
</tr>
<tr>
<td><code>data</code></td>
<td><code>&lt;object&gt;</code></td>
<td>Specifies the URL of the resource for the object.</td>
</tr>
<tr>
<td><code>data-*</code></td>
<td>Global Attributes</td>
<td>Used to store custom data private to the page or application.</td>
</tr>
<tr>
<td><code>datetime</code></td>
<td><code>&lt;del&gt;</code>, <code>&lt;ins&gt;</code>, <code>&lt;time&gt;</code></td>
<td>Specifies the date and time.</td>
</tr>
<tr>
<td><code>default</code></td>
<td><code>&lt;track&gt;</code></td>
<td>Indicates that the track should be enabled if no other track is more appropriate.</td>
</tr>
<tr>
<td><code>defer</code></td>
<td><code>&lt;script&gt;</code></td>
<td>Specifies that the script should be executed when the page has finished parsing (for external scripts).</td>
</tr>
<tr>
<td><code>dir</code></td>
<td>Global Attributes</td>
<td>Sets the text direction for the content in an element.</td>
</tr>
<tr>
<td><code>dirname</code></td>
<td><code>&lt;input&gt;</code>, <code>&lt;textarea&gt;</code></td>
<td>Indicates that the text direction will be submitted.</td>
</tr>
<tr>
<td><code>disabled</code></td>
<td><code>&lt;button&gt;</code>, <code>&lt;fieldset&gt;</code>, <code>&lt;input&gt;</code>, <code>&lt;optgroup&gt;</code>, <code>&lt;option&gt;</code>, <code>&lt;select&gt;</code>, <code>&lt;textarea&gt;</code></td>
<td>Disables the specified element or group of elements.</td>
</tr>
<tr>
<td><code>download</code></td>
<td><code>&lt;a&gt;</code>, <code>&lt;area&gt;</code></td>
<td>Indicates that the target will be downloaded when a user clicks the hyperlink.</td>
</tr>
<tr>
<td><code>draggable</code></td>
<td>Global Attributes</td>
<td>Determines whether an element is draggable or not.</td>
</tr>
<tr>
<td><code>enctype</code></td>
<td><code>&lt;form&gt;</code></td>
<td>Specifies how form-data should be encoded when submitting it to the server (for <code>method="post"</code>).</td>
</tr>
<tr>
<td><code>enterkeyhint</code></td>
<td>Global Attributes</td>
<td>Provides a hint about the text of the enter-key on a virtual keyboard.</td>
</tr>
<tr>
<td><code>for</code></td>
<td><code>&lt;label&gt;</code>, <code>&lt;output&gt;</code></td>
<td>Specifies which form element(s) a label/calculation is bound to.</td>
</tr>
<tr>
<td><code>form</code></td>
<td><code>&lt;button&gt;</code>, <code>&lt;fieldset&gt;</code>, <code>&lt;input&gt;</code>, <code>&lt;label&gt;</code>, <code>&lt;meter&gt;</code>, <code>&lt;object&gt;</code>, <code>&lt;output&gt;</code>, <code>&lt;select&gt;</code>, <code>&lt;textarea&gt;</code></td>
<td>Specifies the name of the form the element belongs to.</td>
</tr>
<tr>
<td><code>formaction</code></td>
<td><code>&lt;button&gt;</code>, <code>&lt;input&gt;</code></td>
<td>Defines where to send form-data when the form is submitted (for <code>type="submit"</code>).</td>
</tr>
<tr>
<td><code>headers</code></td>
<td><code>&lt;td&gt;</code>, <code>&lt;th&gt;</code></td>
<td>Lists one or more header cells related to a cell.</td>
</tr>
<tr>
<td><code>height</code></td>
<td><code>&lt;canvas&gt;</code>, <code>&lt;embed&gt;</code>, <code>&lt;iframe&gt;</code>, <code>&lt;img&gt;</code>, <code>&lt;input&gt;</code>, <code>&lt;object&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Sets the height of the element.</td>
</tr>
<tr>
<td><code>hidden</code></td>
<td>Global Attributes</td>
<td>Indicates that an element is not relevant.</td>
</tr>
<tr>
<td><code>high</code></td>
<td><code>&lt;meter&gt;</code></td>
<td>Defines the range that is considered to be a high value.</td>
</tr>
<tr>
<td><code>href</code></td>
<td><code>&lt;a&gt;</code>, <code>&lt;area&gt;</code>, <code>&lt;base&gt;</code>, <code>&lt;link&gt;</code></td>
<td>Provides the URL of the page the link goes to.</td>
</tr>
<tr>
<td><code>hreflang</code></td>
<td><code>&lt;a&gt;</code>, <code>&lt;area&gt;</code>, <code>&lt;link&gt;</code></td>
<td>Specifies the language of the linked document.</td>
</tr>
<tr>
<td><code>http-equiv</code></td>
<td><code>&lt;meta&gt;</code></td>
<td>Provides an HTTP header for the information/value of the content attribute.</td>
</tr>
<tr>
<td><code>id</code></td>
<td>Global Attributes</td>
<td>Assigns a unique id to an element.</td>
</tr>
<tr>
<td><code>inert</code></td>
<td>Global Attributes</td>
<td>Indicates that the browser should ignore this section.</td>
</tr>
<tr>
<td><code>inputmode</code></td>
<td>Global Attributes</td>
<td>Defines the mode of a virtual keyboard.</td>
</tr>
<tr>
<td><code>ismap</code></td>
<td><code>&lt;img&gt;</code></td>
<td>Specifies an image as a server-side image map.</td>
</tr>
<tr>
<td><code>kind</code></td>
<td><code>&lt;track&gt;</code></td>
<td>Specifies the kind of text track.</td>
</tr>
<tr>
<td><code>label</code></td>
<td><code>&lt;track&gt;</code>, <code>&lt;option&gt;</code>, <code>&lt;optgroup&gt;</code></td>
<td>Provides the title of the text track.</td>
</tr>
<tr>
<td><code>lang</code></td>
<td>Global Attributes</td>
<td>Defines the language of the element’s content.</td>
</tr>
<tr>
<td><code>list</code></td>
<td><code>&lt;input&gt;</code></td>
<td>Refers to a <code>&lt;datalist&gt;</code> element that contains pre-defined options for an <code>&lt;input&gt;</code> element.</td>
</tr>
<tr>
<td><code>loop</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Indicates that the audio/video should start over when finished.</td>
</tr>
<tr>
<td><code>low</code></td>
<td><code>&lt;meter&gt;</code></td>
<td>Defines the range considered to be a low value.</td>
</tr>
<tr>
<td><code>max</code></td>
<td><code>&lt;input&gt;</code>, <code>&lt;meter&gt;</code>, <code>&lt;progress&gt;</code></td>
<td>Specifies the maximum value.</td>
</tr>
<tr>
<td><code>maxlength</code></td>
<td><code>&lt;input&gt;</code>, <code>&lt;textarea&gt;</code></td>
<td>Sets the maximum number of characters allowed in an element.</td>
</tr>
<tr>
<td><code>media</code></td>
<td><code>&lt;a&gt;</code>, <code>&lt;area&gt;</code>, <code>&lt;link&gt;</code>, <code>&lt;source&gt;</code>, <code>&lt;style&gt;</code></td>
<td>Defines what media/device the linked document is optimized for.</td>
</tr>
<tr>
<td><code>method</code></td>
<td><code>&lt;form&gt;</code></td>
<td>Specifies the HTTP method to use when sending form-data.</td>
</tr>
<tr>
<td><code>min</code></td>
<td><code>&lt;input&gt;</code>, <code>&lt;meter&gt;</code></td>
<td>Sets the minimum value.</td>
</tr>
<tr>
<td><code>multiple</code></td>
<td><code>&lt;input&gt;</code>, <code>&lt;select&gt;</code></td>
<td>Allows multiple values to be entered.</td>
</tr>
<tr>
<td><code>muted</code></td>
<td><code>&lt;video&gt;</code>, <code>&lt;audio&gt;</code></td>
<td>Indicates that the audio output should be muted.</td>
</tr>
<tr>
<td><code>name</code></td>
<td><code>&lt;button&gt;</code>, <code>&lt;fieldset&gt;</code>, <code>&lt;form&gt;</code>, <code>&lt;iframe&gt;</code>, <code>&lt;input&gt;</code>, <code>&lt;map&gt;</code>, <code>&lt;meta&gt;</code>, <code>&lt;object&gt;</code>, <code>&lt;output&gt;</code>, <code>&lt;param&gt;</code>, <code>&lt;select&gt;</code>, <code>&lt;textarea&gt;</code></td>
<td>Specifies the name of the element.</td>
</tr>
<tr>
<td><code>novalidate</code></td>
<td><code>&lt;form&gt;</code></td>
<td>Prevents the form from being validated when submitted.</td>
</tr>
<tr>
<td><code>onabort</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;embed&gt;</code>, <code>&lt;img&gt;</code>, <code>&lt;object&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Script to be executed when an operation is aborted.</td>
</tr>
<tr>
<td><code>onafterprint</code></td>
<td><code>&lt;body&gt;</code></td>
<td>Script to be executed after the document is printed.</td>
</tr>
<tr>
<td><code>onbeforeprint</code></td>
<td><code>&lt;body&gt;</code></td>
<td>Script to be executed before the document is printed.</td>
</tr>
<tr>
<td><code>onbeforeunload</code></td>
<td><code>&lt;body&gt;</code></td>
<td>Script to be executed when the document is about to be unloaded.</td>
</tr>
<tr>
<td><code>onblur</code></td>
<td>All visible elements</td>
<td>Script to be executed when an element loses focus.</td>
</tr>
<tr>
<td><code>oncanplay</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Script to be executed when the browser can start playing the media.</td>
</tr>
<tr>
<td><code>onchange</code></td>
<td><code>&lt;input&gt;</code>, <code>&lt;select&gt;</code>, <code>&lt;textarea&gt;</code></td>
<td>Script to be executed when the value of an element changes.</td>
</tr>
<tr>
<td><code>onclick</code></td>
<td>All visible elements</td>
<td>Script to be executed when an element is clicked.</td>
</tr>
<tr>
<td><code>oncontextmenu</code></td>
<td>All visible elements</td>
<td>Script to be executed when the right mouse button is clicked.</td>
</tr>
<tr>
<td><code>oncopy</code></td>
<td>All visible elements</td>
<td>Script to be executed when the content of an element is copied.</td>
</tr>
<tr>
<td><code>oncut</code></td>
<td>All visible elements</td>
<td>Script to be executed when the content of an element is cut.</td>
</tr>
<tr>
<td><code>ondblclick</code></td>
<td>All visible elements</td>
<td>Script to be executed when an element is double-clicked.</td>
</tr>
<tr>
<td><code>ondrag</code></td>
<td>All visible elements</td>
<td>Script to be executed when an element is dragged.</td>
</tr>
<tr>
<td><code>ondragend</code></td>
<td>All visible elements</td>
<td>Script to be executed when a drag operation is completed.</td>
</tr>
<tr>
<td><code>ondragenter</code></td>
<td>All visible elements</td>
<td>Script to be executed when an element is dragged over a valid drop target.</td>
</tr>
<tr>
<td><code>ondragleave</code></td>
<td>All visible elements</td>
<td>Script to be executed when an element leaves a valid drop target.</td>
</tr>
<tr>
<td><code>ondragover</code></td>
<td>All visible elements</td>
<td>Script to be executed when an element is dragged over another element.</td>
</tr>
<tr>
<td><code>ondragstart</code></td>
<td>All visible elements</td>
<td>Script to be executed when a drag operation starts.</td>
</tr>
<tr>
<td><code>ondrop</code></td>
<td>All visible elements</td>
<td>Script to be executed when an element is dropped.</td>
</tr>
<tr>
<td><code>onended</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Script to be executed when the media ends.</td>
</tr>
<tr>
<td><code>onerror</code></td>
<td><code>&lt;img&gt;</code>, <code>&lt;script&gt;</code>, <code>&lt;iframe&gt;</code>, <code>&lt;object&gt;</code></td>
<td>Script to be executed when an error occurs.</td>
</tr>
<tr>
<td><code>onfocus</code></td>
<td>All visible elements</td>
<td>Script to be executed when an element gets focus.</td>
</tr>
<tr>
<td><code>onformchange</code></td>
<td><code>&lt;form&gt;</code></td>
<td>Script to be executed when the form’s elements change.</td>
</tr>
<tr>
<td><code>onforminput</code></td>
<td><code>&lt;form&gt;</code></td>
<td>Script to be executed when an input element within the form changes.</td>
</tr>
<tr>
<td><code>oninput</code></td>
<td>All visible elements</td>
<td>Script to be executed when the value of an input element changes.</td>
</tr>
<tr>
<td><code>oninvalid</code></td>
<td><code>&lt;input&gt;</code>, <code>&lt;select&gt;</code>, <code>&lt;textarea&gt;</code></td>
<td>Script to be executed when an input element fails validation.</td>
</tr>
<tr>
<td><code>onkeydown</code></td>
<td>All visible elements</td>
<td>Script to be executed when a key is pressed.</td>
</tr>
<tr>
<td><code>onkeypress</code></td>
<td>All visible elements</td>
<td>Script to be executed when a key is pressed and released.</td>
</tr>
<tr>
<td><code>onkeyup</code></td>
<td>All visible elements</td>
<td>Script to be executed when a key is released.</td>
</tr>
<tr>
<td><code>onload</code></td>
<td><code>&lt;body&gt;</code>, <code>&lt;iframe&gt;</code>, <code>&lt;img&gt;</code>, <code>&lt;input&gt;</code>, <code>&lt;script&gt;</code></td>
<td>Script to be executed when an element finishes loading.</td>
</tr>
<tr>
<td><code>onloadeddata</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Script to be executed when the media’s data is loaded.</td>
</tr>
<tr>
<td><code>onloadedmetadata</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Script to be executed when the media’s metadata is loaded.</td>
</tr>
<tr>
<td><code>onloadstart</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Script to be executed when the media starts loading.</td>
</tr>
<tr>
<td><code>onmessage</code></td>
<td><code>&lt;iframe&gt;</code>, <code>&lt;object&gt;</code>, <code>&lt;window&gt;</code></td>
<td>Script to be executed when a message is received from another window.</td>
</tr>
<tr>
<td><code>onmousedown</code></td>
<td>All visible elements</td>
<td>Script to be executed when the mouse button is pressed down.</td>
</tr>
<tr>
<td><code>onmousemove</code></td>
<td>All visible elements</td>
<td>Script to be executed when the mouse pointer moves.</td>
</tr>
<tr>
<td><code>onmouseout</code></td>
<td>All visible elements</td>
<td>Script to be executed when the mouse pointer leaves an element.</td>
</tr>
<tr>
<td><code>onmouseover</code></td>
<td>All visible elements</td>
<td>Script to be executed when the mouse pointer is moved onto an element.</td>
</tr>
<tr>
<td><code>onmouseup</code></td>
<td>All visible elements</td>
<td>Script to be executed when the mouse button is released.</td>
</tr>
<tr>
<td><code>onpause</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Script to be executed when the media is paused.</td>
</tr>
<tr>
<td><code>onplay</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Script to be executed when the media starts playing.</td>
</tr>
<tr>
<td><code>onplaying</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Script to be executed when the media starts playing after having been paused.</td>
</tr>
<tr>
<td><code>onprogress</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Script to be executed while the media is being loaded.</td>
</tr>
<tr>
<td><code>onratechange</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Script to be executed when the playback rate changes.</td>
</tr>
<tr>
<td><code>onreset</code></td>
<td><code>&lt;form&gt;</code></td>
<td>Script to be executed when a form is reset.</td>
</tr>
<tr>
<td><code>onscroll</code></td>
<td>All visible elements</td>
<td>Script to be executed when an element is scrolled.</td>
</tr>
<tr>
<td><code>onseeked</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Script to be executed when the user has finished seeking to a new position in the media.</td>
</tr>
<tr>
<td><code>onseeking</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Script to be executed when the user starts seeking to a new position in the media.</td>
</tr>
<tr>
<td><code>onselect</code></td>
<td><code>&lt;input&gt;</code>, <code>&lt;textarea&gt;</code></td>
<td>Script to be executed when text is selected.</td>
</tr>
<tr>
<td><code>onstalled</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Script to be executed when the media has stopped loading.</td>
</tr>
<tr>
<td><code>onsubmit</code></td>
<td><code>&lt;form&gt;</code></td>
<td>Script to be executed when a form is submitted.</td>
</tr>
<tr>
<td><code>onsuspend</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Script to be executed when the media is paused before it can be played.</td>
</tr>
<tr>
<td><code>ontimeupdate</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Script to be executed when the time of the media is updated.</td>
</tr>
<tr>
<td><code>onvolumechange</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Script to be executed when the volume changes.</td>
</tr>
<tr>
<td><code>onwaiting</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Script to be executed when the media pauses to buffer.</td>
</tr>
<tr>
<td><code>open</code></td>
<td><code>&lt;details&gt;</code></td>
<td>Specifies whether the <code>&lt;details&gt;</code> element is open or closed.</td>
</tr>
<tr>
<td><code>optimum</code></td>
<td><code>&lt;meter&gt;</code></td>
<td>Defines the range that is considered optimal.</td>
</tr>
<tr>
<td><code>pattern</code></td>
<td><code>&lt;input&gt;</code></td>
<td>Specifies a regular expression that the input element’s value must match.</td>
</tr>
<tr>
<td><code>placeholder</code></td>
<td><code>&lt;input&gt;</code>, <code>&lt;textarea&gt;</code></td>
<td>Provides a hint to the user about what to enter in an input field.</td>
</tr>
<tr>
<td><code>poster</code></td>
<td><code>&lt;video&gt;</code></td>
<td>Specifies an image to show as a placeholder before the video starts playing.</td>
</tr>
<tr>
<td><code>preload</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Specifies if and how the media should be loaded when the page loads.</td>
</tr>
<tr>
<td><code>readonly</code></td>
<td><code>&lt;input&gt;</code>, <code>&lt;textarea&gt;</code></td>
<td>Specifies that an input field is read-only.</td>
</tr>
<tr>
<td><code>rel</code></td>
<td><code>&lt;a&gt;</code>, <code>&lt;area&gt;</code>, <code>&lt;link&gt;</code></td>
<td>Specifies the relationship between the current document and the linked document.</td>
</tr>
<tr>
<td><code>required</code></td>
<td><code>&lt;input&gt;</code>, <code>&lt;select&gt;</code>, <code>&lt;textarea&gt;</code></td>
<td>Indicates that the user must fill out this field before submitting the form.</td>
</tr>
<tr>
<td><code>reversed</code></td>
<td><code>&lt;ol&gt;</code></td>
<td>Specifies that the list order should be reversed.</td>
</tr>
<tr>
<td><code>rows</code></td>
<td><code>&lt;textarea&gt;</code></td>
<td>Defines the number of visible rows in a text area.</td>
</tr>
<tr>
<td><code>rowspan</code></td>
<td><code>&lt;td&gt;</code>, <code>&lt;th&gt;</code></td>
<td>Specifies how many rows a table cell should span.</td>
</tr>
<tr>
<td><code>sandbox</code></td>
<td><code>&lt;iframe&gt;</code></td>
<td>Enables an extra set of restrictions for the content in an <code>&lt;iframe&gt;</code>.</td>
</tr>
<tr>
<td><code>scope</code></td>
<td><code>&lt;td&gt;</code>, <code>&lt;th&gt;</code></td>
<td>Specifies whether a header cell is a header for a row, column, or group of rows or columns.</td>
</tr>
<tr>
<td><code>selected</code></td>
<td><code>&lt;option&gt;</code></td>
<td>Specifies that an option should be pre-selected.</td>
</tr>
<tr>
<td><code>shape</code></td>
<td><code>&lt;area&gt;</code></td>
<td>Defines the shape of a clickable area in an image map.</td>
</tr>
<tr>
<td><code>size</code></td>
<td><code>&lt;input&gt;</code>, <code>&lt;select&gt;</code></td>
<td>Specifies the width of the element.</td>
</tr>
<tr>
<td><code>sizes</code></td>
<td><code>&lt;link&gt;</code></td>
<td>Specifies the size of the linked resource.</td>
</tr>
<tr>
<td><code>span</code></td>
<td><code>&lt;col&gt;</code></td>
<td>Defines the number of columns a column group should span.</td>
</tr>
<tr>
<td><code>spellcheck</code></td>
<td>Global Attributes</td>
<td>Specifies whether the element should be checked for spelling and grammar.</td>
</tr>
<tr>
<td><code>src</code></td>
<td><code>&lt;audio&gt;</code>, <code>&lt;embed&gt;</code>, <code>&lt;iframe&gt;</code>, <code>&lt;img&gt;</code>, <code>&lt;input&gt;</code>, <code>&lt;script&gt;</code>, <code>&lt;source&gt;</code>, <code>&lt;video&gt;</code></td>
<td>Specifies the URL of the media resource.</td>
</tr>
<tr>
<td><code>srcdoc</code></td>
<td><code>&lt;iframe&gt;</code></td>
<td>Specifies the HTML content to be displayed in an <code>&lt;iframe&gt;</code>.</td>
</tr>
<tr>
<td><code>srclang</code></td>
<td><code>&lt;track&gt;</code></td>
<td>Specifies the language of the track text data.</td>
</tr>
<tr>
<td><code>srcset</code></td>
<td><code>&lt;img&gt;</code>, <code>&lt;source&gt;</code></td>
<td>Defines a set of images to be used by the browser based on the screen size and resolution.</td>
</tr>
<tr>
<td><code>step</code></td>
<td><code>&lt;input&gt;</code></td>
<td>Specifies the legal number intervals for an input field.</td>
</tr>
<tr>
<td><code>summary</code></td>
<td><code>&lt;table&gt;</code></td>
<td>Provides a summary of the content of the table.</td>
</tr>
<tr>
<td><code>tabindex</code></td>
<td>All visible elements</td>
<td>Specifies the tab order of an element.</td>
</tr>
<tr>
<td><code>target</code></td>
<td><code>&lt;a&gt;</code>, <code>&lt;form&gt;</code>, <code>&lt;base&gt;</code></td>
<td>Specifies where to open the linked document or where to submit the form.</td>
</tr>
<tr>
<td><code>title</code></td>
<td>All visible elements</td>
<td>Provides additional information about an element (often shown as a tooltip).</td>
</tr>
<tr>
<td><code>type</code></td>
<td>All visible elements</td>
<td>Specifies the type of element or attribute, such as the type of an input or the type of a script.</td>
</tr>
<tr>
<td><code>usemap</code></td>
<td><code>&lt;img&gt;</code>, <code>&lt;object&gt;</code>, <code>&lt;input&gt;</code></td>
<td>Specifies an image map to be used with the <code>&lt;img&gt;</code>, <code>&lt;object&gt;</code>, or <code>&lt;input&gt;</code> element.</td>
</tr>
<tr>
<td><code>value</code></td>
<td><code>&lt;input&gt;</code>, <code>&lt;button&gt;</code>, <code>&lt;option&gt;</code>, <code>&lt;li&gt;</code></td>
<td>Specifies the value of an element.</td>
</tr>
<tr>
<td><code>width</code></td>
<td><code>&lt;img&gt;</code>, <code>&lt;input&gt;</code>, <code>&lt;iframe&gt;</code>, <code>&lt;video&gt;</code>, <code>&lt;canvas&gt;</code>, <code>&lt;embed&gt;</code></td>
<td>Specifies the width of an element.</td>
</tr>
<tr>
<td><code>wrap</code></td>
<td><code>&lt;textarea&gt;</code></td>
<td>Specifies how the text in a text area should be wrapped.</td>
</tr>
</tbody>
</table>
<p dir="auto">Feel free to ask if you need more details on any of these attributes!</p>
]]></description><link>https://community.secnto.com//topic/2616/html-attribute-reference</link><guid isPermaLink="true">https://community.secnto.com//topic/2616/html-attribute-reference</guid><dc:creator><![CDATA[zaasmi]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[HTML Attributes: A Comprehensive Guide]]></title><description><![CDATA[<p dir="auto">In <strong>HTML</strong>, attributes provide additional information about HTML elements. They are always included in the opening tag and typically come in <strong>name/value pairs</strong> like this: <code>name="value"</code>. Attributes modify the default behavior of elements, allowing you to customize their appearance, functionality, and content.</p>
<p dir="auto">In this guide, we’ll explore some of the most commonly used HTML attributes and best practices for using them.</p>
<hr />
<h3>1. <strong>The <code>href</code> Attribute</strong></h3>
<p dir="auto">The <strong><code>href</code> attribute</strong> is used with the <code>&lt;a&gt;</code> (anchor) tag to define the URL or location of the linked document.</p>
<h4>Example of the <code>href</code> Attribute:</h4>
<pre><code class="language-html">&lt;a href="https://www.example.com"&gt;Visit Example.com&lt;/a&gt;
</code></pre>
<p dir="auto">In this example, clicking the text “Visit <a href="http://Example.com" target="_blank" rel="noopener noreferrer nofollow ugc">Example.com</a>” will take you to the specified URL.</p>
<hr />
<h3>2. <strong>The <code>src</code> Attribute</strong></h3>
<p dir="auto">The <strong><code>src</code> attribute</strong> is used with the <code>&lt;img&gt;</code>, <code>&lt;script&gt;</code>, and <code>&lt;iframe&gt;</code> tags to specify the source (file path or URL) of an image, script, or media content.</p>
<h4>Example of the <code>src</code> Attribute:</h4>
<pre><code class="language-html">&lt;img src="image.jpg" alt="An example image"&gt;
</code></pre>
<p dir="auto">In this example:</p>
<ul>
<li><strong><code>src="image.jpg"</code></strong>: Specifies the location of the image file.</li>
<li><strong><code>alt="An example image"</code></strong>: Provides alternative text (discussed further below).</li>
</ul>
<hr />
<h3>3. <strong>The <code>width</code> and <code>height</code> Attributes</strong></h3>
<p dir="auto">The <strong><code>width</code></strong> and <strong><code>height</code></strong> attributes define the dimensions of an image or other HTML elements. They can be defined either in pixels or as a percentage.</p>
<h4>Example of the <code>width</code> and <code>height</code> Attributes:</h4>
<pre><code class="language-html">&lt;img src="image.jpg" alt="An example image" width="300" height="200"&gt;
</code></pre>
<p dir="auto">In this example:</p>
<ul>
<li><strong><code>width="300"</code></strong>: The image will be 300 pixels wide.</li>
<li><strong><code>height="200"</code></strong>: The image will be 200 pixels tall.</li>
</ul>
<p dir="auto">Using these attributes ensures that the image or media element maintains its intended size, regardless of its original dimensions.</p>
<hr />
<h3>4. <strong>The <code>alt</code> Attribute</strong></h3>
<p dir="auto">The <strong><code>alt</code> attribute</strong> is used with the <code>&lt;img&gt;</code> tag to provide <strong>alternative text</strong>. This text is displayed if the image fails to load and is read by screen readers to make websites accessible to visually impaired users.</p>
<h4>Example of the <code>alt</code> Attribute:</h4>
<pre><code class="language-html">&lt;img src="logo.png" alt="Company Logo"&gt;
</code></pre>
<p dir="auto">In this example:</p>
<ul>
<li><strong><code>alt="Company Logo"</code></strong>: Describes the image as “Company Logo” in case it does not display or for accessibility purposes.</li>
</ul>
<hr />
<h3>5. <strong>The <code>style</code> Attribute</strong></h3>
<p dir="auto">The <strong><code>style</code> attribute</strong> allows you to apply <strong>CSS styles</strong> directly to an HTML element. While using external CSS is generally preferred for maintainability, the <code>style</code> attribute can be handy for quick, inline styling.</p>
<h4>Example of the <code>style</code> Attribute:</h4>
<pre><code class="language-html">&lt;p style="color: blue; font-size: 18px;"&gt;This is a styled paragraph.&lt;/p&gt;
</code></pre>
<p dir="auto">In this example:</p>
<ul>
<li>The paragraph text is blue.</li>
<li>The font size of the text is set to 18 pixels.</li>
</ul>
<hr />
<h3>6. <strong>The <code>lang</code> Attribute</strong></h3>
<p dir="auto">The <strong><code>lang</code> attribute</strong> specifies the <strong>language</strong> of the element’s content. This attribute is important for accessibility tools like screen readers, as well as for search engines.</p>
<h4>Example of the <code>lang</code> Attribute:</h4>
<pre><code class="language-html">&lt;html lang="en"&gt;
</code></pre>
<p dir="auto">In this example:</p>
<ul>
<li><strong><code>lang="en"</code></strong>: Declares that the content of the page is in English.</li>
</ul>
<hr />
<h3>7. <strong>The <code>title</code> Attribute</strong></h3>
<p dir="auto">The <strong><code>title</code> attribute</strong> provides <strong>extra information</strong> about an element. When a user hovers over the element, the text in the <code>title</code> attribute will appear as a tooltip.</p>
<h4>Example of the <code>title</code> Attribute:</h4>
<pre><code class="language-html">&lt;a href="https://www.example.com" title="Go to Example.com"&gt;Visit Example&lt;/a&gt;
</code></pre>
<p dir="auto">In this example:</p>
<ul>
<li>When the user hovers over the link, a tooltip displaying “Go to <a href="http://Example.com" target="_blank" rel="noopener noreferrer nofollow ugc">Example.com</a>” will appear.</li>
</ul>
<hr />
<h3>8. <strong>We Suggest: Always Use Lowercase Attributes</strong></h3>
<p dir="auto">While HTML is not case-sensitive, it is best practice to always write attributes in <strong>lowercase</strong> to maintain consistency and readability. This approach is particularly important when working with XHTML, which is case-sensitive.</p>
<h4>Good Practice:</h4>
<pre><code class="language-html">&lt;img src="image.jpg" alt="Image description"&gt;
</code></pre>
<h4>Bad Practice:</h4>
<pre><code class="language-html">&lt;img SRC="image.jpg" ALT="Image description"&gt;
</code></pre>
<hr />
<h3>9. <strong>We Suggest: Always Quote Attribute Values</strong></h3>
<p dir="auto">It’s best to always <strong>quote attribute values</strong> (using either single or double quotes). Although some browsers may tolerate unquoted values, this can lead to problems with certain values, such as those containing spaces.</p>
<h4>Good Practice:</h4>
<pre><code class="language-html">&lt;a href="https://www.example.com"&gt;Visit Example&lt;/a&gt;
</code></pre>
<h4>Bad Practice:</h4>
<pre><code class="language-html">&lt;a href=https://www.example.com&gt;Visit Example&lt;/a&gt;
</code></pre>
<p dir="auto">Unquoted attribute values can cause issues if the value contains special characters or spaces.</p>
<hr />
<h3>10. <strong>Single or Double Quotes?</strong></h3>
<p dir="auto">In HTML, it doesn’t matter whether you use <strong>single quotes (<code>'</code>)</strong> or <strong>double quotes (<code>"</code>)</strong> for attribute values. Both work fine. However, consistency is important, so pick one style and stick to it throughout your code.</p>
<h4>Example of Single Quotes:</h4>
<pre><code class="language-html">&lt;img src='image.jpg' alt='Image description'&gt;
</code></pre>
<h4>Example of Double Quotes:</h4>
<pre><code class="language-html">&lt;img src="image.jpg" alt="Image description"&gt;
</code></pre>
<p dir="auto">Both examples are valid, but consistency makes your code easier to read and maintain.</p>
<hr />
<h3>11. <strong>Chapter Summary</strong></h3>
<p dir="auto">In this chapter, we covered some of the most important HTML attributes:</p>
<ul>
<li><strong><code>href</code></strong>: Defines the URL of a link.</li>
<li><strong><code>src</code></strong>: Specifies the source of an image or media file.</li>
<li><strong><code>width</code></strong> and <strong><code>height</code></strong>: Set the dimensions of an element.</li>
<li><strong><code>alt</code></strong>: Provides alternative text for images, improving accessibility.</li>
<li><strong><code>style</code></strong>: Allows inline styling of elements.</li>
<li><strong><code>lang</code></strong>: Specifies the language of the content.</li>
<li><strong><code>title</code></strong>: Adds extra information in the form of a tooltip when hovering over an element.</li>
</ul>
<p dir="auto">We also recommended using lowercase for attributes, quoting attribute values, and ensuring consistency with single or double quotes.</p>
<hr />
<h3>12. <strong>HTML Exercises</strong></h3>
<p dir="auto">Here are a few exercises you can try to reinforce what you’ve learned about HTML attributes:</p>
<ol>
<li>
<p dir="auto"><strong>Create a Link</strong>:<br />
Add a link to your favorite website, using the <code>href</code> attribute to specify the URL and the <code>title</code> attribute to add a tooltip.</p>
</li>
<li>
<p dir="auto"><strong>Add an Image</strong>:<br />
Insert an image using the <code>src</code> attribute, and include <code>alt</code>, <code>width</code>, and <code>height</code> attributes.</p>
</li>
<li>
<p dir="auto"><strong>Style an Element</strong>:<br />
Apply inline styles to a paragraph element using the <code>style</code> attribute. Try changing the text color, size, and font family.</p>
</li>
<li>
<p dir="auto"><strong>Language Attribute</strong>:<br />
Set the <code>lang</code> attribute to different languages for various sections of your webpage.</p>
</li>
</ol>
<hr />
<h3>13. <strong>HTML Attribute Reference</strong></h3>
<p dir="auto">For a complete list of HTML attributes, you can refer to the <strong>HTML Attribute Reference</strong> in most documentation sites. This will provide detailed explanations of each attribute, along with their usage and compatibility with different HTML elements.</p>
<hr />
<p dir="auto">By mastering these HTML attributes, you’ll be well on your way to creating more interactive, accessible, and well-structured webpages. Continue practicing to get comfortable using these attributes effectively in your own projects!</p>
]]></description><link>https://community.secnto.com//topic/2615/html-attributes-a-comprehensive-guide</link><guid isPermaLink="true">https://community.secnto.com//topic/2615/html-attributes-a-comprehensive-guide</guid><dc:creator><![CDATA[zaasmi]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>